#! /bin/ksh

t='
	<a name="%ident"></a>
	<h4 style="background: #EEFFFF">%title</h4>
	<p>
		%text
	</p>
	<div test="%5.5fact" style="background: #EEFFEE; margin-left: .5cm"><b> Fun Fact:</b> %fact</div>
'

toc='
	<li><a href="#%ident">%title</a> (updated: %update)
'
toc='
	<tr><td nowrap>
		<a href="#%ident">%title</a>
		</td><td nowrap style="padding-left: 10px">
		 %update
		 </td></tr>
'

function getrecs
{
	sssearch status=released $1
		# sssort -f update:S
}

echo "<!-- generated by genguide -->"
# echo "<h2>Gary Perlman's CHI Guide to Montreal</h2>"
echo '<p><a target=mtl href="http://panorama.sytes.net"><img src="http://shell.pubnix.net/~piper/mtls.jpg" alt="Panoramic view of downtown Montreal from the Mount Royal Lookout - by David Segelstein" height=172 width=640></a>'

echo "<p>"
echo '<a target=mtl href="http://chi2006.org/">CHI 2006</a>,
	for which this guide was written,
	has passed, but people still visit this page.
	It will stay online and maybe get some updates,
	such as for the
	<a target=gi href="http://www.csc.ncsu.edu/faculty/healey/GI_2007/"
		>33rd Graphics Interface Conference</a>, 28-30 May, 2007,
	or <a target=oopsla href="http://oopsla.org/">ooPSLA</a>, 21-25 October, 2007.
	<p>
	<b>
	Try the
	<a target=mtl style="background: #FFFFCC; color: red"
		href="http://maps.google.com/maps/ms?f=q&layer=&ie=UTF8&om=1&msa=0&hl=en&msid=109597231859675089422.0000011204fa04554f835"><img border=0 align=absmiddle src="images/google75x32.gif" height=32 width=75 alt=Google> Map for this Guide!</a>
	</b>
	'

echo "<p>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">
<TR VALIGN=TOP><TD nowrap>
<table border=0 cellpadding=1 cellspacing=0>"
echo "<tr bgcolor=\"#CCCCCC\"><th align=left>Table of Contents, eh?</th>
	<th align=Center>Updated</th></tr>"
getrecs $1 |
	ssformat -t "$toc"
echo '</table>
</TD><TD STYLE="padding: 0 1cm 0 1cm; font-size: 100%">
	<!--
	<div>
	  <a target=mtl href="http://english.wunderground.com/global/stations/71627.html?bannertypeclick=gizmotimetemp">
	  <img src="http://banners.wunderground.com/weathersticker/gizmotimetemp_both/language/english/global/stations/71627.gif" border=0
	  alt="Click for Montreal, Quebec Forecast" height=41 width=127></a>
	</div>
	-->
	<b>Weather Tip:</b>
	<!--
	In late April, wear a light jacket and pack an umbrella.
	-->
	<!--
	It&#39;s summer now, so put on some sunscreen and visit the
	<a target=mtl href="http://www.montrealjazzfest.com/">Jazz Festval</a>
	(although an umbrella is always a good idea).
	-->
	<!--
	The leaves have changed colour and are falling.
	Soon it will be time for snow tires and coco matting.
	-->
	<!--
	It&#39;s winter time and the deep freeze is in.
	Looking forward to spring,
	-->
	It&#39;s spring and everything is blooming in time for Montreal to host the
	<a target=gi href="http://www.csc.ncsu.edu/faculty/healey/GI_2007/"
		>33rd Graphics Interface Conference</a>.
		Have a light jacket for evenings, and have an umbrella
		because in Montr&eacute;, April showers bring May showers.
	- <a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=montreal+quebec" target=mtl
		><nobr>Weather Underground</nobr></a>
	- <a href="http://www.weather.com/outlook/travel/businesstraveler/local/CAXX0301" target=mtl
		><nobr>Weather.com</nobr></a>
	- <a target=mtl href="http://wwwa.accuweather.com/radar-large.asp?partner=accuweather&myadc=0&traveler=0&zipcode=&level=regional&site=NE&anim=loop&type=SIR"
		title="a good map for weather COMING INTO Montreal."
		><nobr>NE AccuWeather map</nobr></a>
	- <a target=mtl href="http://wwwa.accuweather.com/canada-radar-large.asp?partner=accuweather&myadc=0&traveler=0&postalcode=H4B%201W8&site=qb_&anim=LOOP&type=SIR"
		title="Montreal is in southeastern Quebec, so the Quebec weather map shows WHAT WAS in Montreal, not WHAT WILL BE."
		><nobr>QC AccuWeather map</nobr></a>
	<p>
	<b>Money Tip:</b>
	Some credit cards charge a lot to convert from Canadian,
	but you can come to Canada with US dollars and you will tend
	to get a favourable
	<a href="http://finance.yahoo.com/q/bc?s=CADUSD=X&t=5d&l=off&z=m&q=l&c=" target=mtl
		>exchange rate</a> everywhere.
	In any case, Canadian banks are much better at handling US funds than
	US banks are at handling Canadian.
</TD></TR>
</TABLE>
</p>'


getrecs $1 |
	ssformat -t "$t" |
		grep -v 'test=""'
